package com.szxy.backend.item.service.impl;

import com.netflix.discovery.converters.Auto;
import com.szxy.backend.item.feign.CommonItemsFeignClient;
import com.szxy.backend.item.service.ItemCategoryService;
import com.szxy.pojo.TbItemCat;
import com.szxy.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther:zwer
 * @Date:2019/9/7 16:09
 * @Description:com.szxy.backend.item.service.impl
 * @Version:1.0
 **/
@Service
public class ItemCategoryServiceImpl implements ItemCategoryService {

    @Autowired
    private CommonItemsFeignClient commonItemsFeignClient;

    @Override
    public Result selectItemCategoryByParentId(Long id) {
        List<TbItemCat> itemCatList = this.commonItemsFeignClient.selectItemCategoryByParentId(id);
        if(itemCatList !=null && itemCatList.size() != 0){
            return Result.ok(itemCatList);
        }
        return Result.error("查无数据");
    }
}
